package com.ruoyi.xsp.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.xsp.mapper.XspUserLoginLogMapper;
import com.ruoyi.xsp.domain.XspUserLoginLog;
import com.ruoyi.xsp.service.IXspUserLoginLogService;
import com.ruoyi.common.core.text.Convert;

/**
 * 登录日志Service业务层处理
 * 
 * @author zhiminhu
 * @date 2021-01-22
 */
@Service
public class XspUserLoginLogServiceImpl implements IXspUserLoginLogService 
{
    @Autowired
    private XspUserLoginLogMapper xspUserLoginLogMapper;

    /**
     * 查询登录日志
     * 
     * @param id 登录日志ID
     * @return 登录日志
     */
    @Override
    public XspUserLoginLog selectXspUserLoginLogById(Long id)
    {
        return xspUserLoginLogMapper.selectXspUserLoginLogById(id);
    }

    /**
     * 查询登录日志列表
     * 
     * @param xspUserLoginLog 登录日志
     * @return 登录日志
     */
    @Override
    public List<XspUserLoginLog> selectXspUserLoginLogList(XspUserLoginLog xspUserLoginLog)
    {
        return xspUserLoginLogMapper.selectXspUserLoginLogList(xspUserLoginLog);
    }

    /**
     * 新增登录日志
     * 
     * @param xspUserLoginLog 登录日志
     * @return 结果
     */
    @Override
    public int insertXspUserLoginLog(XspUserLoginLog xspUserLoginLog)
    {
        xspUserLoginLog.setCreateTime(DateUtils.getNowDate());
        return xspUserLoginLogMapper.insertXspUserLoginLog(xspUserLoginLog);
    }

    /**
     * 修改登录日志
     * 
     * @param xspUserLoginLog 登录日志
     * @return 结果
     */
    @Override
    public int updateXspUserLoginLog(XspUserLoginLog xspUserLoginLog)
    {
        return xspUserLoginLogMapper.updateXspUserLoginLog(xspUserLoginLog);
    }

    /**
     * 删除登录日志对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteXspUserLoginLogByIds(String ids)
    {
        return xspUserLoginLogMapper.deleteXspUserLoginLogByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除登录日志信息
     * 
     * @param id 登录日志ID
     * @return 结果
     */
    @Override
    public int deleteXspUserLoginLogById(Long id)
    {
        return xspUserLoginLogMapper.deleteXspUserLoginLogById(id);
    }
}
